package com.dt76.smallloanbackenduser.remote.etao;

import com.dt76.smallloanbackenduser.hystrix.etao.RoleHystrix;
import com.dt76.smallloanbackenduser.pojo.etao.Role;
import com.dt76.smallloanbackenduser.utils.Page;
import com.dt76.smallloanbackenduser.utils.Result;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "smallloan-backend-service",fallback = RoleHystrix.class)
public interface RoleManageRemote {

    @RequestMapping("/getAllRole")
    Page getAllRole(@RequestParam("pageIndex") Integer pageIndex);

    @RequestMapping("/getRoleById")
    Role getRoleById(@RequestParam("rId") Integer rId);

    @RequestMapping("/updateRole")
    Result updateRole(@RequestBody Role role);

    @RequestMapping("/addRole")
    Result addRole(@RequestBody Role role);

    @RequestMapping("/delRole")
    Result delRole(@RequestParam("rId") Integer rId);

    @RequestMapping("/getRoleBydId")
    List<Role> getRoleByDid(@RequestParam("dId") Integer dId);

}
